package com.creating.mict.service.impl;

import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import com.creating.mict.dao.PatientDao;
import com.creating.mict.dao.XyjDao;
import com.creating.mict.domain.Contact;
import com.creating.mict.domain.Group;
import com.creating.mict.domain.Patient;
import com.creating.mict.domain.PatientRule;
import com.creating.mict.domain.PatientSetting;
import com.creating.mict.domain.XtyRecord;
import com.creating.mict.domain.XyjRecord;
import com.creating.mict.service.IPatientService;
import com.creating.mict.service.IXyjService;

public class PatientServiceImpl implements IPatientService {

	@Resource
	private PatientDao patientDao;
	
	/**
	 * 
	* @Title: queryPatientSigned 
	* @Description: 获取签约患者
	* @param @param loginName
	* @param @param fbtime
	* @param @param fetime
	* @param @param fkeywords
	* @param @param foffice
	* @param @return 
	* @return List<Patient>    返回类型 
	* @throws
	 */
	public List<Patient> queryPatientSigned(String loginName, String loginType, String fbtime, String fetime, String fstate, String fkeywords, String foffice) {
		return patientDao.queryPatientSigned(loginName, loginType, fbtime, fetime, fstate, fkeywords, foffice);
	}

	/**
	 * 
	* @Title: queryPatientByKeyWords 
	* @Description: 根据身份证号、医保号、uid、手机号获取患者对象
	* @param @return 
	* @return Patient    返回类型 
	* @throws
	 */
	public Patient queryPatientByKeyWords(String fkeywords) {
		return patientDao.queryPatientByKeyWords(fkeywords);
	}
	
	/**
	 * 
	* @Title: changePatientState 
	* @Description: 更新签约状态
	* @param @param fpid
	* @param @param fstate
	* @param @return 
	* @return boolean    返回类型 
	* @throws
	 */
	public boolean changeSignState(String fpid, String fstate) {
		return patientDao.changeSignState(fpid, fstate);
	}
	
	/**
	 * 
	* @Title: deleteSignInfo 
	* @Description: 删除签约信息
	* @param @param fpid
	* @param @return 
	* @return boolean    返回类型 
	* @throws
	 */
	public boolean deleteSignInfo(String fpid) {
		return patientDao.deleteSignInfo(fpid);
	}
	
	/**
	 * 
	* @Title: signPatientXyj 
	* @Description: 保存签约信息 
	* @param @param pa
	* @param @return 
	* @return boolean    返回类型 
	* @throws
	 */
	public boolean savePatientInfo(Patient pa) {
		return patientDao.savePatientInfo(pa);
	}
	
	/**
	 * 
	* @Title: getPatientInfoById 
	* @Description: 根据id获取签约患者
	* @param @return 
	* @return PatientInfo    返回类型 
	* @throws
	 */
	public Patient getPatientInfoById(String fpid) {
		return patientDao.getPatientInfoById(fpid);
	}
	
	/**
	 * 
	* @Title: queryContact 
	* @Description: 根据身份证号获取联系人
	* @param @param fidcd
	* @param @return 
	* @return List<Contact>    返回类型 
	* @throws
	 */
	public List<Contact> queryContact(String fidcd) {
		return patientDao.queryContact(fidcd);
	}
	
	/**
	 * 
	* @Title: saveContact 
	* @Description: 保存联系人
	* @param @return 
	* @return Boolean    返回类型 
	* @throws
	 */
	public Boolean saveContact(Contact ca) {
		return patientDao.saveContact(ca);
	}
	
	/**
	 * 
	* @Title: deleteContact 
	* @Description: 删除签约患者联系人 
	* @param @return 
	* @return boolean    返回类型 
	* @throws
	 */
	public boolean deleteContact(String fidcd, String fphone) {
		return patientDao.deleteContact(fidcd, fphone);
	}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	/**
	 * 
	* @Title: savePatientSetting 
	* @Description: 保存设置信息 
	* @param @return 
	* @return boolean    返回类型 
	* @throws
	 */
	public boolean savePatientSetting(PatientSetting ps) {
		return patientDao.savePatientSetting(ps);
	}
	

	/**
	 * 
	* @Title: getPatientSettingInfoByPhone 
	* @Description: 获取患者设置信息 
	* @param @param fphone
	* @param @return 
	* @return PatientSetting    返回类型 
	* @throws
	 */
	public PatientSetting getPatientSettingInfoByPhone(String fphone) { 
		return patientDao.getPatientSettingInfoByPhone(fphone);
	}
	
	/**
	 * 获取群组列表
	* @Title: queryGroup 
	* @Description: TODO(这里用一句话描述这个方法的作用) 
	* @param @param fuser
	* @param @return 
	* @return List<Group>    返回类型 
	* @throws
	 */
	public List<Group> queryGroupList(String fuser) {
		return patientDao.queryGroupList(fuser);
	}
	
	/**
	 * 删除群组
	* @Title: deleteGroupByFid 
	* @Description: TODO(这里用一句话描述这个方法的作用) 
	* @param @param fid
	* @param @return 
	* @return boolean    返回类型 
	* @throws
	 */
	public boolean deleteGroupByFid(String fid) {
		return patientDao.deleteGroupByFid(fid);
	}
	
	/**
	 * 
	* @Title: groupingPatient 
	* @Description: 分组 
	* @param @param fid
	* @param @return 
	* @return boolean    返回类型 
	* @throws
	 */
	public boolean groupingPatient(String fid, String fgroup) {
		return patientDao.groupingPatient(fid, fgroup);
	}
	
	/**
	 * 保存群组
	* @Title: saveGroup 
	* @Description: TODO(这里用一句话描述这个方法的作用) 
	* @param @param group
	* @param @return 
	* @return boolean    返回类型 
	* @throws
	 */
	public boolean saveGroup(Group group) {
		return patientDao.saveGroup(group); 
	}
	
}
